'use strict';

const Controller = require('egg').Controller;

class FeedbackController extends Controller {
  async list() {
    const {ctx,app}=this
    const {type,wxname}=ctx.query
    let where={},Op=app.Sequelize.Op
    if(type!=''&&type!=undefined){
        where.type={
            [Op.like]:`%${type}%`
        }
    }
    if(wxname!=''&&wxname!=undefined){
        where.type={
            [Op.like]:`%${wxname}%`
        }
    }
    let list=await ctx.page(app.model.Feedback,where)
    ctx.apiSuccess(list)
  }
}

module.exports = FeedbackController;
